import express from 'express'
let router = express.Router()

import { getHomeData } from '../server/home.js'
import { login, getUserInfo } from '../server/user.js'  
import { postcrypto } from '../server/crypto.js'
import { uploadImage } from '../server/image.js'

import handleImage from '../maddleware/handleImage.js'

router.get('/api/data',getHomeData)
router.get('/api/user', getUserInfo)

router.post('/api/login', login) // 登录

router.post('/api/postCrypto', postcrypto) // 加密解密

router.post('/api/uploadImage',handleImage.single('image'), uploadImage) // 上传图片

export default router